﻿@model FILSTARTUPS_CMS.Models.Post

@{
    ViewBag.Title = "Create";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@section Pagename
{
<h2>Create Post</h2>
}

@if (TempData["message"] != null)
{
<div class="alert-message error span13 left"id="tempdata"><center>@TempData["message"]</center></div>
}


@using (Html.BeginForm("Create", "Post", FormMethod.Post, new { @class="form-stacked", enctype = "multipart/form-data"}))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Post</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.posttitle)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.posttitle)
            @Html.ValidationMessageFor(model => model.posttitle)
        </div>

        <div class="editor-label">
          Featured Post:@Html.CheckBoxFor(model => model.featuredpost)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.postdescription)
            @Html.ValidationMessageFor(model => model.postdescription)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.postdescription, new { @class = "ckeditor" })
        </div>



        <div class="editor-label">
            Category
        </div>
        <div class="editor-field">
            @Html.DropDownList("catidPK", new SelectList(ViewData["catidPK"] as System.Collections.IEnumerable,
                                                              "catidPK", "categoryname"))
            
        </div>
          <div class="editor-label">
            Routing Type
        </div>
        <div class="editor-field">
            @Html.DropDownList("routingidFK", new SelectList(ViewData["routingidFK"] as System.Collections.IEnumerable,
                                                              "routingidPK", "routingname"))
            
        </div>

        <div class="editor-label">
            Upload Image:
            <input type="file" name="postimage"  id="postimage"  />
        </div>
            <br />
        <p>
            <input type="submit" value="Create" class="ui-button-text" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
